﻿using UnityEngine;

public class RigidBodyMgr : IRigidBodyMgr {
	readonly Rigidbody2D rb;
	float _initGravity;

	public RigidBodyMgr(Rigidbody2D rb, float initGravity) {
		this.rb = rb;
		_initGravity = initGravity;
	}

	public Vector2 Velocity { get => rb.velocity; set => rb.velocity = value; }

	public void ResetGravity() {
		rb.gravityScale = _initGravity;
	}

	public void SetGravity(float gravity) {
		rb.gravityScale = gravity;
	}

	public void SetVelocity(Vector2 v) {
		rb.velocity = v;
	}
}